package com.coolgor.axnut.enums.airuc;

public enum CourseStateEnum {
	SUCCESS(1000, "操作成功"), 
	INNER_ERROR(-1001, "内部系统错误"), 
	NULL_COURSEID(-1002, "Id为空"),
	NULL(-1004, "获取数据为空"), 
	EMPTY_LIST(-1005, "数据列表为空");

	private int state;

	private String stateInfo;

	private CourseStateEnum(int state, String stateInfo) {
		this.state = state;
		this.stateInfo = stateInfo;
	}

	public int getState() {
		return state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public static CourseStateEnum stateOf(int index) {
		for (CourseStateEnum state : values()) {
			if (state.getState() == index) {
				return state;
			}
		}
		return null;
	}
}
